package cn.bdqn.service.impl;

import cn.bdqn.entity.Actor;
import cn.bdqn.dao.ActorDao;
import cn.bdqn.service.ActorService;
import org.springframework.stereotype.Service;
import java.util.List;
import javax.annotation.Resource;

@Service
public class ActorServiceImpl implements ActorService {
    @Resource
    private ActorDao actorDao;

    @Override
    public List<Actor> queryAll() {
        return this.actorDao.queryAll();
    }
    
    @Override
    public Actor queryById(Integer actorId) {
        return this.actorDao.queryById(actorId);
    }
    @Override
    public Actor insert(Actor actor) {
        this.actorDao.insert(actor);
        return actor;
    }

    @Override
    public Actor update(Actor actor) {
        this.actorDao.update(actor);
        return this.queryById(actor.getActorId());
    }

    @Override
    public boolean deleteById(Integer actorId) {
        return this.actorDao.deleteById(actorId) > 0;
    }
}
